<?php 
add_action( 'init', 'register_custom_tours' );

function register_custom_tours() {	

	$labels = array(
	    'name' 					=> _x('Tours', 'Tours'),
	    'singular_name' 		=> _x('Tours', 'Tours'),
	    'add_new' 				=> _x('Add new', 'Tours'),
	    'add_new_item' 			=> __('Add new Tours'),
	    'edit_item' 			=> __('Edit Tours'),
	    'new_item' 				=> __('New Tours'),
	    'all_items' 			=> __('All Tours'),
	    'view_item'				=> __('View Tours'),
	    'search_items'			=> __('Search Tours'),
	    'not_found' 			=> __('Not found Tours'),
	    'not_found_in_trash' 	=> __('Not found Tours'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Tours'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	'taxonomies'			 => array('post_tag'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('tour',$args);	
	  
}


##=============================================================================================

add_action( 'init', 'register_custom_news_event' );
function register_custom_news_event() 
{	

	$labels = array(
	    'name' 					=> _x('News', 'News'),
	    'singular_name' 		=> _x('News', 'News'),
	    'add_new' 				=> _x('Add new', 'News'),
	    'add_new_item' 			=> __('Add new News'),
	    'edit_item' 			=> __('Edit News'),
	    'new_item' 				=> __('new News'),
	    'all_items' 			=> __('All News'),
	    'view_item'				=> __('View News'),
	    'search_items'			=> __('Search News'),
	    'not_found' 			=> __('Not found News'),
	    'not_found_in_trash' 	=> __('Not found News'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'News'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			 => array('category'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('news-event',$args);
	  ## post_tag for page
	  register_taxonomy_for_object_type('post_tag', 'page');	  	
}

##=============================================================================================


add_action( 'init', 'register_custom_restaurants' );
function register_custom_restaurants() 
{	

	$labels = array(
	    'name' 					=> _x('Restaurant', 'Restaurant'),
	    'singular_name' 		=> _x('Restaurant', 'Restaurant'),
	    'add_new' 				=> _x('Add new', 'Restaurant'),
	    'add_new_item' 			=> __('Add new Restaurant'),
	    'edit_item' 			=> __('Edit Restaurant'),
	    'new_item' 				=> __('New Restaurant'),
	    'all_items' 			=> __('All Restaurant'),
	    'view_item'				=> __('View Restaurant'),
	    'search_items'			=> __('Search Restaurant'),
	    'not_found' 			=> __('Not found Restaurant'),
	    'not_found_in_trash' 	=> __('Not found Restaurant'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Restaurant'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	'taxonomies'			 => array('category-restaurant'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','excerpt')
	  ); 
	  register_post_type('restaurant',$args);	
}

##=============================================================================================

add_action( 'init', 'register_custom_partner' );
function register_custom_partner() 
{	

	$labels = array(
	    'name' 					=> _x('Partner', 'Partner'),
	    'singular_name' 		=> _x('Partner', 'Partner'),
	    'add_new' 				=> _x('Add new', 'Partner'),
	    'add_new_item' 			=> __('Add new Partner'),
	    'edit_item' 			=> __('Edit Partner'),
	    'new_item' 				=> __('New Partner'),
	    'all_items' 			=> __('All Partner'),
	    'view_item'				=> __('View Partner'),
	    'search_items'			=> __('Search Partner'),
	    'not_found' 			=> __('Not found Partner'),
	    'not_found_in_trash' 	=> __('Not found Partner'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Partner'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			 => array('category'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('partner',$args);	
}

##=============================================================================================

add_action( 'init', 'register_custom_adv_image' );
function register_custom_adv_image() 
{	

	$labels = array(
	    'name' 					=> _x('Adv image', 'Adv image'),
	    'singular_name' 		=> _x('Adv image', 'Adv image'),
	    'add_new' 				=> _x('Add new', 'Adv image'),
	    'add_new_item' 			=> __('Adv New Adv image'),
	    'edit_item' 			=> __('Edit Adv image'),
	    'new_item' 				=> __('New Adv image'),
	    'all_items' 			=> __('All Adv image'),
	    'view_item'				=> __('View Adv image'),
	    'search_items'			=> __('Search Adv image'),
	    'not_found' 			=> __('Not found Adv image'),
	    'not_found_in_trash' 	=> __('Not found Adv image'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Adv image'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	'taxonomies'			 => array('show-on-page'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title')
	  ); 
	  register_post_type('adv',$args);	
}

##=============================================================================================


add_action( 'init', 'register_custom_banner' );
function register_custom_banner() {	

	$labels = array(
	    'name' 					=> _x('Banner', 'Banner'),
	    'singular_name' 		=> _x('Banner', 'Banner'),
	    'add_new' 				=> _x('Add new', 'Banner'),
	    'add_new_item' 			=> __('Add new Banner'),
	    'edit_item' 			=> __('Edit Banner'),
	    'new_item' 				=> __('New Banner'),
	    'all_items' 			=> __('All Banner'),
	    'view_item'				=> __('View Banner'),
	    'search_items'			=> __('Search Banner'),
	    'not_found' 			=> __('Not found Banner'),
	    'not_found_in_trash' 	=> __('Not found Banner'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Banner'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			=> array('show-on-page'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title')
	  ); 
	  register_post_type('banner',$args);	
}

##=============================================================================================

##=============================================================================================


add_action( 'init', 'register_custom_slideshow' );
function register_custom_slideshow()
{	

	$labels = array(
	    'name' 					=> _x('Slide Show', 'Slide Show'),
	    'singular_name' 		=> _x('Slide Show', 'Slide Show'),
	    'add_new' 				=> _x('Add new', 'Slide Show'),
	    'add_new_item' 			=> __('Add new Slide Show'),
	    'edit_item' 			=> __('Edit Slide Show'),
	    'new_item' 				=> __('New Slide Show'),
	    'all_items' 			=> __('All Slide Show'),
	    'view_item'				=> __('View Slide Show'),
	    'search_items'			=> __('Search Slide Show'),
	    'not_found' 			=> __('Not found Slide Show'),
	    'not_found_in_trash' 	=> __('Not found Slide Show'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Slide Show'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	  	//'taxonomies'			 => array('category'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title')
	  ); 
	  register_post_type('slide-show',$args);	
}



add_action( 'init', 'register_image_testimonial' );
function register_image_testimonial() {	

	$labels = array(
	    'name' 					=> _x('Testimonial', 'Testimonial'),
	    'singular_name' 		=> _x('Testimonial', 'Testimonial'),
	    'add_new' 				=> _x('Add new', 'Testimonial'),
	    'add_new_item' 			=> __('Add new Testimonial'),
	    'edit_item' 			=> __('Edit Testimonial'),
	    'new_item' 				=> __('New Testimonial'),
	    'all_items' 			=> __('All Testimonial'),
	    'view_item'				=> __('View Testimonial'),
	    'search_items'			=> __('Search Testimonial'),
	    'not_found' 			=> __('Not found Testimonial'),
	    'not_found_in_trash' 	=> __('Not found Testimonial'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Testimonial'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	    //'taxonomies'			 => array('muc-slide-show'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('testimonial',$args);	
}

//add_action( 'init', 'register_image_ticket' );
function register_image_ticket() {	

	$labels = array(
	    'name' 					=> _x('Tichket', 'Tichket'),
	    'singular_name' 		=> _x('Tichket', 'Tichket'),
	    'add_new' 				=> _x('Add new', 'Tichket'),
	    'add_new_item' 			=> __('Add new Tichket'),
	    'edit_item' 			=> __('Edit Tichket'),
	    'new_item' 				=> __('New Tichket'),
	    'all_items' 			=> __('All Tichket'),
	    'view_item'				=> __('View Tichket'),
	    'search_items'			=> __('Search Tichket'),
	    'not_found' 			=> __('Not found Tichket'),
	    'not_found_in_trash' 	=> __('Not found Tichket'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'Ticket'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'post',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	    'taxonomies'			 => array('category-ticket'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('ticket',$args);	
}

//add_action( 'init', 'register_image_newpage' );
function register_image_newpage() {	

	$labels = array(
	    'name' 					=> _x('My Page', 'My Page'),
	    'singular_name' 		=> _x('My Page', 'My Page'),
	    'add_new' 				=> _x('Add new', 'My Page'),
	    'add_new_item' 			=> __('Add new My Page'),
	    'edit_item' 			=> __('Edit My Page'),
	    'new_item' 				=> __('New My Page'),
	    'all_items' 			=> __('All My Page'),
	    'view_item'				=> __('View My Page'),
	    'search_items'			=> __('Search My Page'),
	    'not_found' 			=> __('Not found My Page'),
	    'not_found_in_trash' 	=> __('Not found My Page'), 
	    'parent_item_colon' 	=> '',
	    'menu_name' 			=> 'My Page'
	
	  );
	  $args = array(
	    'labels' 				=> $labels,
	    'public' 				=> true,
	    'publicly_queryable' 	=> true,
	    'show_ui' 				=> true, 
	    'show_in_menu' 			=> true, 
	    'query_var' 			=> true,
	    'rewrite' 				=> true,
	    'capability_type' 		=> 'page',
	    'has_archive' 			=> true, 
	    'hierarchical' 			=> false,
	    'menu_position' 		=> 5,
	    //'taxonomies'			 => array('category-ticket'),
	  	'menu_icon'				=> get_stylesheet_directory_uri().'/admins/images/setting_icon.jpg',  	
	    'supports' 				=> array('title','editor')
	  ); 
	  register_post_type('my-page',$args);	
}
##=============================================================================================


function my_feed_request($qv) {
	    if (isset($qv['feed']) && !isset($qv['post_type']))
	        $qv['post_type'] = array('post','tour');
	    return $qv;
	}
add_filter('request', 'my_feed_request');
?>